package javase2.day05.demo01;
/*
public static <T> T requireNonNull(T obj) :查看指定引用对象不是null
源码：
    public static <T> T requireNonNull(T obj) {
            if (obj == null)
                throw new NullPointerException();
                 return obj; }
 */
public class Objects {
    public static void main(String[] args) {
        method(null);
    }

    public static void method(Object obj){
//        if (obj==null){
//            throw new NullPointerException("传递空参数");
//        }
        java.util.Objects.requireNonNull(obj);
    }

}
